import { SUPPLIER_CATEGORY_SELECT_LIST } from '@/pages/supplier/constants/common'
import { list2Obj } from '@/pages/supplier/utils';
const currentYear = new Date().getFullYear();
// 待考察供应商列表
const FORM_ITEM_LIST = [
  {
    prop: 'supplierCode',
    label: '供应商代码',
    type: 'input'
  },
  {
    prop: 'supplierName',
    label: '供应商名称',
    type: 'input'
  },
  {
    prop: 'businessContactName',
    label: '业务对接人',
    type: 'input'
  },
  {
    prop: 'supplierManagerAreaId',
    label: '管理区域',
    type: 'managementArea'
  },
  {
    prop: 'supplierClassify',
    label: '供应商分类',
    type: 'select',
    clearable: true,
    options: [
      { value: 40332, label: '合格供应商' },
      { value: 40331, label: '潜在供应商' },
    ],
  },
]
const TABLE_COLUMNS = [
  {
    title: '序号',
    key: 'index',
    width: 50
  },
  {
    title: '区域',
    key: 'areaName'
  },
  {
    title: '供应商代码',
    key: 'supplierCode'
  },
  {
    title: '供应商名称',
    key: 'supplierName',
  },
  {
    title: '供应商分类',
    key: 'supplierClassify',
    formatter: (row, columns, cellValue) => {
      return list2Obj(SUPPLIER_CATEGORY_SELECT_LIST)[cellValue]
    }
  },
  {
    title: '业务对接人',
    key: 'businessContactName',
  },
  {
    title: `${currentYear}年度进货额`,
    key: 'currYearPurchaseAmount'
  },
  {
    title: `${currentYear - 1}年度进货额`,
    key: 'lastOneYearPurchaseAmount'
  },
  {
    title: `${currentYear - 2}年度进货额`,
    key: 'lastTwoYearPurchaseAmount'
  },
  {
    title: `${currentYear - 3}年度进货额`,
    key: 'lastThreeYearPurchaseAmount'
  },
  {
    title: `${currentYear - 4}年度进货额`,
    key: 'lastFourYearPurchaseAmount'
  },
  {
    title: `${currentYear - 5}年度进货额`,
    key: 'lastFiveYearPurchaseAmount'
  },
  {
    title: `${currentYear - 6}年度进货额`,
    key: 'lastSixYearPurchaseAmount'
  },
]
export {
  FORM_ITEM_LIST,
  TABLE_COLUMNS
}
